package com.woniuxy.userapp.client;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.woniuxy.commons.util.Result;
import com.woniuxy.userapp.client.param.LoginInfo;
import com.woniuxy.userapp.client.param.UserInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Mr.zhou
 * \* Date: 2022/8/6
 * \* Time: 16:40
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */

@FeignClient(contextId = "BackgroundAccountClient",name="yoga-user", path="/user")
@Component
public interface BackgroundAccountClient {

    @ApiOperation("根据用户名获取后台用户信息")
    @RequestMapping(value = "/backgroundAccount/BloadByUsername",method = RequestMethod.GET)
    public Result<UserInfo> BloadUserByUsername(@RequestParam String userName);


    @ApiOperation("后台账户登录")
    @RequestMapping(value = "/backLogin",method = RequestMethod.POST)
    public Result login(@RequestBody LoginInfo loginInfo) throws HttpRequestMethodNotSupportedException;

    @ApiOperation("登出")
    @RequestMapping(value = "/logout",method = RequestMethod.POST)
    public Result logout();


    @ApiOperation("测试")
    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public Result test() throws JsonProcessingException;
}
